<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>RTW Report - sum.c</title>
<script language="JavaScript" type="text/javascript" src="rtwreport_utils.js"></script>
</head>
<body bgcolor="#eeeeee" text="#1122aa" onload="try {if (top) { if (top.rtwFileOnLoad) top.rtwFileOnLoad(window.document); else local_onload();}} catch(err) {};">
<p>
<table border="0" cellspacing="0" cellpadding="6" width="100%%" height="100%%"><tr><td width="100%%" valign="top" bgcolor="#ffffff">
<h4>File: <a href="../sum.c" target="rtwreport_document_frame" id="linkToText_plain">sum.c</a></h4>
<pre id="RTWcode">
<a name="1"><font color="#888888 "><i>    1   </i></font></a><font color="#117755"><i>/*</i></font>
<a name="2"><font color="#888888 "><i>    2   </i></font></a><font color="#117755"><I> * sum.c</i></font>
<a name="3"><font color="#888888 "><i>    3   </i></font></a><font color="#117755"><I> *</i></font>
<a name="4"><font color="#888888 "><i>    4   </i></font></a><font color="#117755"><I> * Code generation for function 'sum'</i></font>
<a name="5"><font color="#888888 "><i>    5   </i></font></a><font color="#117755"><I> *</i></font>
<a name="6"><font color="#888888 "><i>    6   </i></font></a><font color="#117755"><I> */</i></font>
<a name="7"><font color="#888888 "><i>    7   </i></font></a>
<a name="8"><font color="#888888 "><i>    8   </i></font></a><font color="#117755"><i>/* Include files */</i></font>
<a name="9"><font color="#888888 "><i>    9   </i></font></a><font color="#992211">#</font><font color="#992211"><b>include</b></font> <font color="#992211">&quot;rt_nonfinite.h&quot;</font>
<a name="10"><font color="#888888 "><i>   10   </i></font></a><font color="#992211">#</font><font color="#992211"><b>include</b></font> <font color="#992211">&quot;master_function_v4.h&quot;</font>
<a name="11"><font color="#888888 "><i>   11   </i></font></a><font color="#992211">#</font><font color="#992211"><b>include</b></font> <font color="#992211">&quot;sum.h&quot;</font>
<a name="12"><font color="#888888 "><i>   12   </i></font></a><font color="#992211">#</font><font color="#992211"><b>include</b></font> <font color="#992211">&quot;master_function_v4_mexutil.h&quot;</font>
<a name="13"><font color="#888888 "><i>   13   </i></font></a><font color="#992211">#</font><font color="#992211"><b>include</b></font> <font color="#992211">&quot;master_function_v4_data.h&quot;</font>
<a name="14"><font color="#888888 "><i>   14   </i></font></a>
<a name="15"><font color="#888888 "><i>   15   </i></font></a><font color="#117755"><i>/* Function Definitions */</i></font>
<a name="16"><font color="#888888 "><i>   16   </i></font></a>real_T <a name="fcn_sum">sum</a>(<font color="#112266"><b>const</b></font> emlrtStack *sp, <font color="#112266"><b>const</b></font> real_T x_data[], <font color="#112266"><b>const</b></font> int32_T x_size[2])
<a name="17"><font color="#888888 "><i>   17   </i></font></a><b>{</b>
<a name="18"><font color="#888888 "><i>   18   </i></font></a>  real_T y;
<a name="19"><font color="#888888 "><i>   19   </i></font></a>  boolean_T p;
<a name="20"><font color="#888888 "><i>   20   </i></font></a>  boolean_T b_p;
<a name="21"><font color="#888888 "><i>   21   </i></font></a>  int32_T i;
<a name="22"><font color="#888888 "><i>   22   </i></font></a>  int32_T exitg1;
<a name="23"><font color="#888888 "><i>   23   </i></font></a>  <font color="#112266"><b>const</b></font> mxArray *b_y;
<a name="24"><font color="#888888 "><i>   24   </i></font></a>  <font color="#112266"><b>static</b></font> <font color="#112266"><b>const</b></font> int32_T iv4[2] = <b>{</b> 1, 30 <b>}</b>;
<a name="25"><font color="#888888 "><i>   25   </i></font></a>
<a name="26"><font color="#888888 "><i>   26   </i></font></a>  <font color="#112266"><b>const</b></font> mxArray *m1;
<a name="27"><font color="#888888 "><i>   27   </i></font></a>  char_T cv8[30];
<a name="28"><font color="#888888 "><i>   28   </i></font></a>  <font color="#112266"><b>static</b></font> <font color="#112266"><b>const</b></font> char_T cv9[30] = <b>{</b> <font color="#1122ff">'C'</font>, <font color="#1122ff">'o'</font>, <font color="#1122ff">'d'</font>, <font color="#1122ff">'e'</font>, <font color="#1122ff">'r'</font>, <font color="#1122ff">':'</font>, <font color="#1122ff">'t'</font>, <font color="#1122ff">'o'</font>, <font color="#1122ff">'o'</font>,
<a name="29"><font color="#888888 "><i>   29   </i></font></a>    <font color="#1122ff">'l'</font>, <font color="#1122ff">'b'</font>, <font color="#1122ff">'o'</font>, <font color="#1122ff">'x'</font>, <font color="#1122ff">':'</font>, <font color="#1122ff">'s'</font>, <font color="#1122ff">'u'</font>, <font color="#1122ff">'m'</font>, <font color="#1122ff">'_'</font>, <font color="#1122ff">'s'</font>, <font color="#1122ff">'p'</font>, <font color="#1122ff">'e'</font>, <font color="#1122ff">'c'</font>, <font color="#1122ff">'i'</font>, <font color="#1122ff">'a'</font>,
<a name="30"><font color="#888888 "><i>   30   </i></font></a>    <font color="#1122ff">'l'</font>, <font color="#1122ff">'E'</font>, <font color="#1122ff">'m'</font>, <font color="#1122ff">'p'</font>, <font color="#1122ff">'t'</font>, <font color="#1122ff">'y'</font> <b>}</b>;
<a name="31"><font color="#888888 "><i>   31   </i></font></a>
<a name="32"><font color="#888888 "><i>   32   </i></font></a>  <font color="#112266"><b>const</b></font> mxArray *c_y;
<a name="33"><font color="#888888 "><i>   33   </i></font></a>  <font color="#112266"><b>static</b></font> <font color="#112266"><b>const</b></font> int32_T iv5[2] = <b>{</b> 1, 36 <b>}</b>;
<a name="34"><font color="#888888 "><i>   34   </i></font></a>
<a name="35"><font color="#888888 "><i>   35   </i></font></a>  char_T cv10[36];
<a name="36"><font color="#888888 "><i>   36   </i></font></a>  <font color="#112266"><b>static</b></font> <font color="#112266"><b>const</b></font> char_T cv11[36] = <b>{</b> <font color="#1122ff">'C'</font>, <font color="#1122ff">'o'</font>, <font color="#1122ff">'d'</font>, <font color="#1122ff">'e'</font>, <font color="#1122ff">'r'</font>, <font color="#1122ff">':'</font>, <font color="#1122ff">'t'</font>, <font color="#1122ff">'o'</font>, <font color="#1122ff">'o'</font>,
<a name="37"><font color="#888888 "><i>   37   </i></font></a>    <font color="#1122ff">'l'</font>, <font color="#1122ff">'b'</font>, <font color="#1122ff">'o'</font>, <font color="#1122ff">'x'</font>, <font color="#1122ff">':'</font>, <font color="#1122ff">'a'</font>, <font color="#1122ff">'u'</font>, <font color="#1122ff">'t'</font>, <font color="#1122ff">'o'</font>, <font color="#1122ff">'D'</font>, <font color="#1122ff">'i'</font>, <font color="#1122ff">'m'</font>, <font color="#1122ff">'I'</font>, <font color="#1122ff">'n'</font>, <font color="#1122ff">'c'</font>,
<a name="38"><font color="#888888 "><i>   38   </i></font></a>    <font color="#1122ff">'o'</font>, <font color="#1122ff">'m'</font>, <font color="#1122ff">'p'</font>, <font color="#1122ff">'a'</font>, <font color="#1122ff">'t'</font>, <font color="#1122ff">'i'</font>, <font color="#1122ff">'b'</font>, <font color="#1122ff">'i'</font>, <font color="#1122ff">'l'</font>, <font color="#1122ff">'i'</font>, <font color="#1122ff">'t'</font>, <font color="#1122ff">'y'</font> <b>}</b>;
<a name="39"><font color="#888888 "><i>   39   </i></font></a>
<a name="40"><font color="#888888 "><i>   40   </i></font></a>  emlrtStack st;
<a name="41"><font color="#888888 "><i>   41   </i></font></a>  emlrtStack b_st;
<a name="42"><font color="#888888 "><i>   42   </i></font></a>  st.prev = sp;
<a name="43"><font color="#888888 "><i>   43   </i></font></a>  st.tls = sp-&gt;tls;
<a name="44"><font color="#888888 "><i>   44   </i></font></a>  b_st.prev = sp;
<a name="45"><font color="#888888 "><i>   45   </i></font></a>  b_st.tls = sp-&gt;tls;
<a name="46"><font color="#888888 "><i>   46   </i></font></a>  p = false;
<a name="47"><font color="#888888 "><i>   47   </i></font></a>  b_p = false;
<a name="48"><font color="#888888 "><i>   48   </i></font></a>  i = 0;
<a name="49"><font color="#888888 "><i>   49   </i></font></a>  <font color="#112266"><b>do</b></font> <b>{</b>
<a name="50"><font color="#888888 "><i>   50   </i></font></a>    exitg1 = 0;
<a name="51"><font color="#888888 "><i>   51   </i></font></a>    <font color="#112266"><b>if</b></font> (i &lt; 2) <b>{</b>
<a name="52"><font color="#888888 "><i>   52   </i></font></a>      <font color="#112266"><b>if</b></font> (x_size[i] != 0) <b>{</b>
<a name="53"><font color="#888888 "><i>   53   </i></font></a>        exitg1 = 1;
<a name="54"><font color="#888888 "><i>   54   </i></font></a>      <b>}</b> <font color="#112266"><b>else</b></font> <b>{</b>
<a name="55"><font color="#888888 "><i>   55   </i></font></a>        i++;
<a name="56"><font color="#888888 "><i>   56   </i></font></a>      <b>}</b>
<a name="57"><font color="#888888 "><i>   57   </i></font></a>    <b>}</b> <font color="#112266"><b>else</b></font> <b>{</b>
<a name="58"><font color="#888888 "><i>   58   </i></font></a>      b_p = true;
<a name="59"><font color="#888888 "><i>   59   </i></font></a>      exitg1 = 1;
<a name="60"><font color="#888888 "><i>   60   </i></font></a>    <b>}</b>
<a name="61"><font color="#888888 "><i>   61   </i></font></a>  <b>}</b> <font color="#112266"><b>while</b></font> (exitg1 == 0);
<a name="62"><font color="#888888 "><i>   62   </i></font></a>
<a name="63"><font color="#888888 "><i>   63   </i></font></a>  <font color="#112266"><b>if</b></font> (!b_p) <b>{</b>
<a name="64"><font color="#888888 "><i>   64   </i></font></a>  <b>}</b> <font color="#112266"><b>else</b></font> <b>{</b>
<a name="65"><font color="#888888 "><i>   65   </i></font></a>    p = true;
<a name="66"><font color="#888888 "><i>   66   </i></font></a>  <b>}</b>
<a name="67"><font color="#888888 "><i>   67   </i></font></a>
<a name="68"><font color="#888888 "><i>   68   </i></font></a>  <font color="#112266"><b>if</b></font> (!p) <b>{</b>
<a name="69"><font color="#888888 "><i>   69   </i></font></a>  <b>}</b> <font color="#112266"><b>else</b></font> <b>{</b>
<a name="70"><font color="#888888 "><i>   70   </i></font></a>    b_y = NULL;
<a name="71"><font color="#888888 "><i>   71   </i></font></a>    m1 = emlrtCreateCharArray(2, iv4);
<a name="72"><font color="#888888 "><i>   72   </i></font></a>    <font color="#112266"><b>for</b></font> (i = 0; i &lt; 30; i++) <b>{</b>
<a name="73"><font color="#888888 "><i>   73   </i></font></a>      cv8[i] = cv9[i];
<a name="74"><font color="#888888 "><i>   74   </i></font></a>    <b>}</b>
<a name="75"><font color="#888888 "><i>   75   </i></font></a>
<a name="76"><font color="#888888 "><i>   76   </i></font></a>    emlrtInitCharArrayR2013a(sp, 30, m1, cv8);
<a name="77"><font color="#888888 "><i>   77   </i></font></a>    emlrtAssign(&amp;b_y, m1);
<a name="78"><font color="#888888 "><i>   78   </i></font></a>    st.site = &amp;<a href="master_function_v4_data_c.html#var_m_emlrtRSI" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'var_m_emlrtRSI');" target="_self"><font color="#1122aa">m_emlrtRSI</font></a>;
<a name="79"><font color="#888888 "><i>   79   </i></font></a>    b_st.site = &amp;<a href="master_function_v4_data_c.html#var_r_emlrtRSI" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'var_r_emlrtRSI');" target="_self"><font color="#1122aa">r_emlrtRSI</font></a>;
<a name="80"><font color="#888888 "><i>   80   </i></font></a>    <a href="master_function_v4_mexutil_c.html#fcn_error" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'fcn_error');" target="_self"><font color="#1122aa">error</font></a>(&amp;st, <a href="master_function_v4_mexutil_c.html#fcn_message" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'fcn_message');" target="_self"><font color="#1122aa">message</font></a>(&amp;b_st, b_y, &amp;<a href="master_function_v4_data_c.html#var_b_emlrtMCI" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'var_b_emlrtMCI');" target="_self"><font color="#1122aa">b_emlrtMCI</font></a>), &amp;<a href="master_function_v4_data_c.html#var_c_emlrtMCI" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'var_c_emlrtMCI');" target="_self"><font color="#1122aa">c_emlrtMCI</font></a>);
<a name="81"><font color="#888888 "><i>   81   </i></font></a>  <b>}</b>
<a name="82"><font color="#888888 "><i>   82   </i></font></a>
<a name="83"><font color="#888888 "><i>   83   </i></font></a>  <font color="#112266"><b>if</b></font> ((x_size[1] == 1) || (x_size[1] != 1)) <b>{</b>
<a name="84"><font color="#888888 "><i>   84   </i></font></a>    p = true;
<a name="85"><font color="#888888 "><i>   85   </i></font></a>  <b>}</b> <font color="#112266"><b>else</b></font> <b>{</b>
<a name="86"><font color="#888888 "><i>   86   </i></font></a>    p = false;
<a name="87"><font color="#888888 "><i>   87   </i></font></a>  <b>}</b>
<a name="88"><font color="#888888 "><i>   88   </i></font></a>
<a name="89"><font color="#888888 "><i>   89   </i></font></a>  <font color="#112266"><b>if</b></font> (p) <b>{</b>
<a name="90"><font color="#888888 "><i>   90   </i></font></a>  <b>}</b> <font color="#112266"><b>else</b></font> <b>{</b>
<a name="91"><font color="#888888 "><i>   91   </i></font></a>    c_y = NULL;
<a name="92"><font color="#888888 "><i>   92   </i></font></a>    m1 = emlrtCreateCharArray(2, iv5);
<a name="93"><font color="#888888 "><i>   93   </i></font></a>    <font color="#112266"><b>for</b></font> (i = 0; i &lt; 36; i++) <b>{</b>
<a name="94"><font color="#888888 "><i>   94   </i></font></a>      cv10[i] = cv11[i];
<a name="95"><font color="#888888 "><i>   95   </i></font></a>    <b>}</b>
<a name="96"><font color="#888888 "><i>   96   </i></font></a>
<a name="97"><font color="#888888 "><i>   97   </i></font></a>    emlrtInitCharArrayR2013a(sp, 36, m1, cv10);
<a name="98"><font color="#888888 "><i>   98   </i></font></a>    emlrtAssign(&amp;c_y, m1);
<a name="99"><font color="#888888 "><i>   99   </i></font></a>    st.site = &amp;<a href="master_function_v4_data_c.html#var_l_emlrtRSI" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'var_l_emlrtRSI');" target="_self"><font color="#1122aa">l_emlrtRSI</font></a>;
<a name="100"><font color="#888888 "><i>  100   </i></font></a>    b_st.site = &amp;<a href="master_function_v4_data_c.html#var_q_emlrtRSI" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'var_q_emlrtRSI');" target="_self"><font color="#1122aa">q_emlrtRSI</font></a>;
<a name="101"><font color="#888888 "><i>  101   </i></font></a>    <a href="master_function_v4_mexutil_c.html#fcn_error" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'fcn_error');" target="_self"><font color="#1122aa">error</font></a>(&amp;st, <a href="master_function_v4_mexutil_c.html#fcn_message" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'fcn_message');" target="_self"><font color="#1122aa">message</font></a>(&amp;b_st, c_y, &amp;<a href="master_function_v4_data_c.html#var_d_emlrtMCI" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'var_d_emlrtMCI');" target="_self"><font color="#1122aa">d_emlrtMCI</font></a>), &amp;<a href="master_function_v4_data_c.html#var_e_emlrtMCI" onclick="if (top) if (top.docHiliteMe) top.docHiliteMe(window, 'var_e_emlrtMCI');" target="_self"><font color="#1122aa">e_emlrtMCI</font></a>);
<a name="102"><font color="#888888 "><i>  102   </i></font></a>  <b>}</b>
<a name="103"><font color="#888888 "><i>  103   </i></font></a>
<a name="104"><font color="#888888 "><i>  104   </i></font></a>  <font color="#112266"><b>if</b></font> (x_size[1] == 0) <b>{</b>
<a name="105"><font color="#888888 "><i>  105   </i></font></a>    y = 0.0;
<a name="106"><font color="#888888 "><i>  106   </i></font></a>  <b>}</b> <font color="#112266"><b>else</b></font> <b>{</b>
<a name="107"><font color="#888888 "><i>  107   </i></font></a>    y = x_data[0];
<a name="108"><font color="#888888 "><i>  108   </i></font></a>    <font color="#112266"><b>for</b></font> (i = 2; i &lt;= x_size[1]; i++) <b>{</b>
<a name="109"><font color="#888888 "><i>  109   </i></font></a>      y += x_data[i - 1];
<a name="110"><font color="#888888 "><i>  110   </i></font></a>    <b>}</b>
<a name="111"><font color="#888888 "><i>  111   </i></font></a>  <b>}</b>
<a name="112"><font color="#888888 "><i>  112   </i></font></a>
<a name="113"><font color="#888888 "><i>  113   </i></font></a>  <font color="#112266"><b>return</b></font> y;
<a name="114"><font color="#888888 "><i>  114   </i></font></a><b>}</b>
<a name="115"><font color="#888888 "><i>  115   </i></font></a>
<a name="116"><font color="#888888 "><i>  116   </i></font></a><font color="#117755"><i>/* End of code generation (sum.c) */</i></font>
<a name="117"><font color="#888888 "><i>  117   </i></font></a></pre>
</td></tr></table>
</p>
</body>
</html>